/*
 *  Macros.h
 *  T3nsors
 *
 *  Created by Michael Barriault on 10-09-23.
 *  Copyright 2010 MikBarr Studios. All rights reserved.
 *
 */

#pragma once

#define real double
#define FOR(n,N) for ( int n=0; n<N; n++ )
#define FRO(n,o,N) for ( int n=o; n<N; n++ )
#define FBY(n,N,dn) for ( int n=0; n<N; n+=dn )
#define FORa for ( int a=0; a<3; a++ )
#define FORb for ( int b=0; b<3; b++ )
#define FORO for ( int o=0; o<O(); o++ )
#define DEBUGNO
#define FORALL(i,j,k) for ( int i=0; i<O->at(0); i++ ) for ( int j=0; j<O->at(1); j++ ) for ( int k=0; k<O->at(2); k++ )
#define FORLR(i) for ( int i=-1; i<=0; i++ )

#define PFOR(n,N) _Pragma("omp parallel for") for ( int n=0; n<N; n++ )
#define PFORO _Pragma("omp parallel for") for ( int o=0; o<O(); o++ )
#define PFORLR(i) _Pragma("omp parallel for") for ( int i=-1; i<=0; i++ )

#define THREAD(fname,obj) boost::thread(boost::bind(&fname,obj))
